package com.downguys.exception;

/**
 * @author xiyang.qiao
 * @date 2017/1/3 - 18:53
 */
public enum CommonErrorCode implements IErrorCode {

    /** 系统错误 */
    SYSTEM_ERROR(10001,"System error"),

    /** 服务暂停 */
    SERVICE_UNAVAILABLE(10002,"Service unavailable"),

    /** 远程服务错误 */
    REMOTE_SERVICE_ERROR(10003,"Remote service error"),

    /** IP 限制不能请求该资源 */
    IP_LIMITED(10004,"IP limit"),

    /** 请求被禁止*/
    ACCESS_FORBIDDEN(10005,"Access forbidden"),

    /** 未被授权的访问*/
    UNAUTHORIZED_CLIENT(10006,"Unauthorized client"),

    /** 参数错误 */
    ILLEGAL_ARGUMENTS(20001,"illegal arguments")
    ;


    private int returnCode;

    private String returnMessage;

    @Override
    public int getReturnCode() {
        return this.returnCode;
    }

    @Override
    public String getReturnMessage() {
        return this.getReturnMessage();
    }

    private CommonErrorCode(int returnCode, String returnMessage) {
        this.returnCode = returnCode;
        this.returnMessage = returnMessage;
    }
}
